<!doctype html>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
 String path = request.getContextPath();
 String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
	<head>
		<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
		<%@ include file="/WEB-INF/views-jsp/include/taglib/taglib.jsp" %>
		<%@ include file="/WEB-INF/views-jsp/include/meta/meta.jsp" %>
		<%@ include file="/WEB-INF/views-jsp/include/link/link.jsp" %>
		<%@ include file="/WEB-INF/views-jsp/include/script/script.jsp" %>
		<link rel="stylesheet" type="text/css" href="${path}/html/js/js-resource/imgPreview/css/style.css"/>
		<script type="text/javascript" src="${path}/html/js/jquery.form.js"></script>
		<script type="text/javascript" src="${path}/html/js/js-jsp/uploadFile.js"></script>
		<script type="text/javascript" src="${path}/html/js/js-jsp/common/select-plugin.js?v=1"></script>
		<script type="text/javascript" src="${path}/html/js/js-resource/imgPreview/js/lightBox.js"></script>
		<script type="text/javascript" src="${path}/html/js/js-jsp/us/company/companyOption.js?v=<%out.print(Math.random());%>"></script>
	</head>
	<body>
		<div class="place">
			<span>当前位置：</span>
			<ul class="placeul">
				<li><a href="${path}/company/index.do">企业信息</a></li>
				<c:if test="${company.companyId == null}">
					<li><a>添加公司</a></li>
				</c:if>
				<c:if test="${company.companyId != null}">
					<li><a>修改公司</a></li>
				</c:if>
			</ul>
		</div>
		<form id="operate_form" class="form" method="post" action="#" enctype="multipart/form-data">
			<div class="formbody">
				<div class="formtitle"><span>公司基本信息</span></div>
				<table id="companyDesc" align="center" border="0" width="100%" style="font-size: 12px;">
					<tr height="50px">
						<!-- companyIdInit 用于页面头部公司logo修改 -->
						<input type="hidden" id="companyIdInit_" value="${sessionScope.SERVER_SESSION_USER.directCompany.companyId}"/>
						<input type="hidden" name="companyId" id="companyId_" value="${company.companyId}"/>
						<input type="hidden" name="defaultCompanyId" id="defaultCompanyId" value="${sessionScope.SERVER_SESSION_USER.user.companyId}">
						<input type="hidden" name="parentId" id="parentId" value="${company.parentId}"/>
						<input type="hidden" name="compCode" value="${company.compCode}"/>
						<input type="hidden" id="oldCompanyName" value="${company.name}"/>
						<td align="right">所属公司：</td>
						<td align="left"><input id="parentIdTree" class="easyui-combotree" style="width:255px; height: 32px" prompt="--请选择--"/></td>
						<td align="right">公司名称：</td>
						<td align="left">
							<input class="easyui-textbox" name="name" id="name" required="true" data-options="validType:['length[1,20]','companyNameIsExists[\'oldCompanyName\']']"
								    style="width:255px; height: 32px" missingMessage="公司名称不能为空" prompt="请输入公司名称" value="${company.name}"/>
						</td>
					</tr>
					<tr height="50px">
						<td align="right">公司类型：</td>
						<td align="left">
							<input class="select-commonDict" name="compType" id="compType" data-modelCode="PR" editable="false" validType="selectNotEmpty['公司类型']"
								   data-funCode="unitProperty" data-valueField="cdId"    defualt-value="${company.compType}"  style="width:255px; height: 32px" >
						</td>
						<td align="right">营业执照号：</td>
						<td align="left">
							<input class="easyui-textbox" name="registerID" id="registerID" data-options="required:true,validType:'length[1,20]'" missingMessage="营业执照注册号不能为空"
								    style="width:255px; height: 32px" prompt="请输入营业执照注册号" value="${company.registerID}"/>
						</td>
					</tr>
					<tr height="50px">
						<td align="right">注册资本(万)：</td>
						<td align="left">
							<input class="easyui-numberbox" name="registerCapital" id="registerCapital" data-options="min:0,precision:2,validType:'length[1,12]'",
								   style="width:255px; height: 32px" prompt="请输入注册资本" value="${company.registerCapital}"/>
						</td>
						<td align="right">注册币种：</td>
						<td align="left">
							<input class="select-commonDict" name="registerCurrency" data-modelCode="US" data-funCode="registerCurrency" editable="false"
								   data-valueField="cdId" style="width:255px; height: 32px"  defualt-value="${company.registerCurrency}">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">注册日期：</td>
						<td align="left">
							<input id="registerDate"  style="width:255px; height: 32px"	class="easyui-datebox" name="registerDate" data-options="prompt:'请选择注册日期',editable:false,required:'true'" value="<fmt:formatDate value="${company.registerDate}" pattern="yyyy-MM-dd"/>" missingMessage="注册日期不能为空">
						</td>
						<td align="right">公司网址：</td>
						<td align="left">
							<input class="easyui-textbox" name="companySites" id="companySites" data-options="validType:'length[1,50]'" style="width:255px; height: 32px" prompt="请输入公司网址" value="${company.companySites}"/>
						</td>
					</tr>
					<tr height="50px">
						<td align="right">联系人：</td>
						<td align="left">
							<input class="easyui-textbox" name="linkmanName" id="linkmanName" data-options="validType:'length[1,6]'"
								   value="${company.linkmanName}" prompt="请输入联系人姓名" required="true" missingMessage="联系人姓名不能为空" style="width:255px; height: 32px"/>
						</td>
						<td align="right">联系人手机号码：</td>
						<td align="left">
							<input class="easyui-textbox" name="linkmanPhone" id="linkmanPhone" prompt="请输入联系人手机号码" required="true" missingMessage="联系人手机号码不能为空"
								   value="${company.linkmanPhone}" data-options="validType:['mobile','length[1,11]']" style="width:255px; height: 32px">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">公司法人：</td>
						<td align="left">
							<input class="easyui-textbox" name="master" id="master" data-options="validType:'length[1,5]'"
								   value="${company.master}" required="true" missingMessage="法人不能为空"  prompt="请输入法人" style="width:255px; height: 32px">
						</td>
						<td align="right">法人职务：</td>
						<td align="left">
							<input class="easyui-textbox" name="masterJob" id="masterJob" data-options="validType:'length[1,20]'"
								   value="${company.masterJob}" prompt="请输入法人职务"  style="width:255px; height: 32px">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">法人证件号：</td>
						<td align="left" id="masterCertNumTd_">
							<input class="easyui-textbox masterCertNum" id="masterCertNum_" name="masterCertNum" id="masterCertNum" data-options="validType:['idcard','length[1,18]']"
								   value="${company.masterCertNum}" prompt="请输入法人证件号"  style="width:255px; height: 32px">
						</td>
						<td align="right">法人证件类型：</td>
						<td align="left">
							<input type="hidden" id="masterCertTypeHd" name="masterCertType" value="${company.masterCertType}">
							<input class="easyui-combobox" id="masterCertType_" editable="false" style="width:255px; height: 32px" >
						</td>
					</tr>
					<tr height="50px">
						<td align="right">法人职称：</td>
						<td align="left">
							<input class="easyui-textbox" name="masterJobTitle" id="masterJobTitle" data-options="validType:'length[1,20]'"
								   value="${company.masterJobTitle}" prompt="请输入法人职称"  style="width:255px; height: 32px">
						</td>
						<td align="right">法人手机号：</td>
						<td align="left">
							<input class="easyui-textbox" name="masterPhone" id="masterPhone" data-options="validType:['mobile','length[1,11]']"
								   value="${company.masterPhone}" style="width:255px; height: 32px" prompt="请输入法人电话">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">注册地址：</td>
						<td align="left">
							<input class="select-region" name="registerProvice" set-cityId="registerCity" set-districtId="registerDistrict" editable="false"
								   defualt-value="${company.registerProvice}"  style="width:82px; height: 32px" value="${company.registerProvice}"/>
							<input class="easyui-combobox" name="registerCity" id="registerCity" editable="false"
								   value="${company.registerCity}" style="width:83px; height: 32px"/>
							<input class="easyui-combobox" name="registerDistrict" id="registerDistrict"
								   value="${company.registerDistrict}"  style="width:83px; height: 32px"/>
						</td>
						<td align="right">运营地址：</td>
						<td align="left">
							<input class="select-region" name="operatingProvice"  set-cityId="operatingCity" set-districtId="operatingDistrict" editable="false"
								   defualt-value="${company.operatingProvice}" style="width:82px; height: 32px" value="${company.operatingProvice}"/>
							<input class="easyui-combobox" name="operatingCity" id="operatingCity"
								   value="${company.operatingCity}" style="width:83px; height: 32px"/>
							<input class="easyui-combobox" name="operatingDistrict" id="operatingDistrict"
								   value="${company.operatingDistrict}" prompt="请输入运营所在区/县" style="width:83px; height: 32px"/>
						</td>
					</tr>
					<tr height="50px">
						<td align="right">注册详细地址：</td>
						<td align="left">
							<input class="easyui-textbox" name="registerAddress" id="registerAddress" data-options="validType:'length[1,50]'"
								   value="${company.registerAddress}" prompt="请输入注册详细地址" style="width:255px; height: 32px">
						</td>
						<td align="right">运营详细地址：</td>
						<td align="left">
							<input class="easyui-textbox" name="operatingAddress" id="operatingAddress" data-options="validType:'length[1,50]'"
								   value="${company.operatingAddress}" prompt="请输入运营详细地址" style="width:255px; height: 32px">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">联系人办公电话：</td>
						<td align="left">
							<input class="easyui-textbox" name="linkmanOfficePhone" id="linkmanOfficePhone" data-options="validType:['phone','length[1,12]']"
								   value="${company.linkmanOfficePhone}" prompt="请输入联系人办公电话" style="width:255px; height: 32px">
						</td>
						<td align="right">邮政编码：</td>
						<td align="left">
							<input class="easyui-numberbox" name="postCode" id="postCode"  prompt="请输入邮政编码" data-options="validType:'length[1,6]'" value="${company.postCode}"
								   style="width:255px; height: 32px">
						</td>
					</tr>
					<tr height="50px">
						<td align="right">公司logo：</td>
						<td align="left">
							<input class="easyui-filebox"  id="uploadfile" name="uploadfile" data-options="buttonText:'选择图像',prompt:'请选择公司logo', onChange:function(){ $('#uploadBtn').linkbutton({ disabled:false }) }" style="width:255px; height: 32px" />
							<a id="uploadBtn" class="easyui-linkbutton" style="width:60px; height: 28px" > 上传 </a>
							<a id="browseBtn" class="easyui-linkbutton" style="width:60px; height: 28px"> 浏览 </a>
							<!--以下属于上传附带参数-->
							<input type="hidden" id="fileId" name="fileId" value="${commonFile.fileId}" />
							<input type="hidden" name="fkType" value="COMPANYLOGO" />
							<input type="hidden" name="modelName" value="用户板块" />
							<input type="hidden" name="modelCode" value="US" />
							<input type="hidden" name="funName" value="公司logo" />
							<input type="hidden" name="funCode" value="companyLogo" />
							<input type="hidden" id="fileName" name="fileName" value="${commonFile.name}" />
							<input type="hidden" id="url" name="url" value="${commonFile.url}" />
							<input type="hidden" id="size" name="size" />
							<input type="hidden" id="fix" name="fix" />
							<input type="hidden" id="md5" name="md5" />
						</td>
						<td align="right">固定电话：</td>
						<td align="left">
							<input class="easyui-textbox" name="phone" data-options="validType:['phone','length[1,12]']" value="${company.phone}" style="width:255px; height: 32px" prompt="请输入固定电话">
						</td>
						<%--<td align="right">公司icon：</td>
						<td align="left">
							<input class="easyui-filebox" id="compIcon" data-options="buttonText:'选择',prompt:'请选择公司icon'" style="width:255px; height: 32px">
						</td>--%>
						<%--<td align="right">公司背景图：</td>
						<td align="left">
							<input class="easyui-filebox" id="compBg" data-options="buttonText:'选择',prompt:'请选择公司背景图'" style="width:255px; height: 32px" >
						</td>--%>
					</tr>
					<tr height="50px">
						<td align="right">公司传真：</td>
						<td align="left">
							<input class="easyui-textbox" name="fax" data-options="validType:['fax','length[1,12]']" value="${company.fax}" style="width:255px; height: 32px" prompt="请输入传真">
						</td>
						<td align="right">公司邮箱：</td>
						<td align="left">
							<input class="easyui-textbox" name="email" value="${company.email}" data-options="validType:['email','length[1,20]']"
								   style="width:255px; height: 32px" prompt="请输入邮箱">
						</td>
					</tr>
					<tr height="50px">
						<td align="right" valign="top">备注信息：</td>
						<td align="left">
							<input class="easyui-textbox" name="remark" data-options="multiline:true,validType:'length[1,200]'"
								   value="${company.remark}" style="width:255px;height:100px" prompt="请输入备注信息">
						</td>
					</tr>
					<tr class="formbody"  align="center">
						<td colspan="4">
							<div>
								<a id="optionCompany" class="easyui-linkbutton c1" style="width:120px; height: 35px">保存</a>
								&nbsp;&nbsp;&nbsp;
								<a href="${path}/company/index.do" class="easyui-linkbutton c1" style="width:120px; height: 35px">取消</a>
							</div>
						</td>
					</tr>
				</table>
			</div>
		</form>
	</body>
	<script>
		jQuery(document).ready(function($) {
		   $.LightBox({speed:500});
		});
	</script>
</html>